package com.lzc.springboot.mapper;

import com.lzc.springboot.domain.Crop;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface CropMapper {

  /**
   * 查询所有农作物信息
   * @return
   */
  @Select("select * from crops")
  @Options(useCache = false, flushCache = Options.FlushCachePolicy.TRUE)
  Crop[] findAll();

  @Select("select crop_name from crops where id=#{cropId}")
  @Options(useCache = false, flushCache = Options.FlushCachePolicy.TRUE)
  String findCropNameByCropId(int cropId);
}
